package org.mockito.learningtests;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import android.test.AndroidTestCase;

public class BindingTests extends AndroidTestCase {

	private SimpleTestClass classUnderTest;

	public void setUp() throws Exception {
		classUnderTest = mock(SimpleTestClass.class);
	}

	public void testGetString() {
		String expected = "String";
		when(classUnderTest.getString()).thenReturn(expected);
		assertEquals(expected, classUnderTest.getString());
	}

	public void testGetInteger() {
		Integer expected = 1;
		when(classUnderTest.getInteger()).thenReturn(expected);
		assertEquals(expected, classUnderTest.getInteger());
	}

	public void testGetInt() {
		int expected = 1;
		when(classUnderTest.getInt()).thenReturn(expected);
		assertEquals(expected, classUnderTest.getInt());
	}

	public void testMethodWithArguments() {
		String expectedReturn = "Test";
		String testArgument = "Test";
		when(classUnderTest.methodWithArgument(testArgument)).thenReturn(expectedReturn);

		assertEquals(expectedReturn, classUnderTest.methodWithArgument(testArgument));
	}

}
